<?php
/**
 * TomatoCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version 	$Id: Auth.php 3971 2010-07-25 10:26:42Z huuphuoc $
 * @since		2.0.0
 */

class Core_Services_Image 
{
	public static function getResourceImage($resource_type,$resource_id,$fileName){
		return Tomato_Config::getConfig()->get("web")->url->static.'/resource/'
				. substr(Tomato_Config::getConfig()->get("db")->prefix, 0,-1).'/'
				. Zend_Auth::getInstance()->getIdentity()->shop->id.'/images/'
				.$resource_type.'s/'
				.$resource_id  .'/'.$fileName; 
	}
	public static function getResourceNoImage($resource_type){
		return Tomato_Config::getConfig()->get("web")->url->static.'/images/'
				.'noImage/'.$resource_type.'/no-image.png';
	}
	public static function getIcon($type="waiting"){
		if($type=="waiting")		
		return Tomato_Config::getConfig()->get("web")->url->static.'/images/icons/waiting.gif';
	}
}
